import requests


#搜索
keyword = '斗破苍穹'
keyword = keyword.encode('utf-8')
search_api_url = 'http://127.0.0.1:8000/booktxt/api_search'
response = requests.post(search_api_url,data = {'keyword':keyword})
response.encoding = 'utf-8'
print(response.json())


#主页
homepage_api_url = 'http://127.0.0.1:8000/booktxt/api_homepage'
response = requests.post(homepage_api_url,data = {'home_page':'homepage'})
response.encoding = 'utf-8'
print(response.json())


#书本
bookinfo_api_url = 'http://127.0.0.1:8000/booktxt/api_bookinfo'
book_url = 'https://www.booktxt.net/10_10363/'
response = requests.post(bookinfo_api_url,data = {'book_url':book_url})
response.encoding = 'utf-8'
print(response.json())


#章节
bookinfo_api_url = 'http://127.0.0.1:8000/booktxt/api_chapter'
chapter_url = 'https://www.booktxt.net/10_10363/4587243.html'
response = requests.post(bookinfo_api_url,data = {'chapter_url':chapter_url})
response.encoding = 'utf-8'
print(response.json())
